package com.data.construct.binaryTree;

/**
 * 一个简单的二叉树节点类
 * @author sunhl
 * @Description:
 * @Date: created in 2024/11/11 0011 10:08
 * @Modified By:
 */
public class TreeNode {
    int val;
    TreeNode left;
    TreeNode right;
    TreeNode(int x) { this.val = x; }

    public static void main(String[] args) {
        // 你可以这样构建一棵二叉树：
        TreeNode root = new TreeNode(1);
        root.left = new TreeNode(2);
        root.right = new TreeNode(3);
        root.left.left = new TreeNode(4);
        root.right.left = new TreeNode(5);
        root.right.right = new TreeNode(6);

        // 构建出来的二叉树是这样的：
        //     1
        //    / \
        //   2   3
        //  /   / \
        // 4   5   6
    }
}
